<?php

// 连接数据库
$dbc = mysqli_connect('localhost','root','root','site');
// var_dump($dbc);

// 设定连接器编码
mysqli_set_charset($dbc, 'utf8');

// 拼接SQL语句
$query = 'SELECT * FROM `user` LIMIT 0 , 30';

// 查询结果
$result = mysqli_query($dbc, $query);

echo "<table border = 1>";
while ($row = mysqli_fetch_array($result)) {
echo "<tr><td>". $row['uid'] . '</td><td>' . $row['uemail'] . '</td><td>' . $row['uregdate'] . '</td></tr>'; 
}
echo "</table>";

// 释放结果集
mysqli_free_result ($result);
// 释放连接
mysqli_close($dbc);

?>